<style>
iframe {
	border: 0;
}
</style>

{% extends "accounts/base.html" %}
{% load url from future %}

{% block logo_title %}
<div>
<img src="/static/img/logo.png" alt="logo" />
<span>Knownsec.com</span>
</div>
{% endblock %}

{% block login_box %}
{% if user.is_authenticated %}
<iframe id="muser_iframe" src="/muser/" height="420" width="480" seamless="seamless"></iframe>
<p><a href="/accounts/logout/">Logout</a>
{% else %}
<iframe id="login_iframe" src="/accounts/login/?next=/" height="320" width="480" seamless="seamless"></iframe>
{% endif %}
{% endblock %}

{% block intro_face %}
{% if user.is_authenticated %}
<iframe id="mbook_iframe" src="/mbook/" height="480" width="720" seamless="seamless"></iframe>
<script>
var i1 = document.getElementById("muser_iframe"),
    i2 = document.getElementById("mbook_iframe");
i1.onload = i2.onload = function () {
    var ancs = i2.contentDocument.getElementsByClassName("reserving-button");
	// alert(ancs[0].innerHTML);
	for (var a = 0; a < ancs.length; a++) {
	    ancs[a].addEventListener("click", function (e) {
		    i1.contentDocument.location.reload();
			return false;
        });
    }
};
</script>
{% else %}
<div>
lib-ms ...
</div>
{% endif %}
{% endblock %}

{% block footer_copyright %}
<div>
All Rights Reserved, &copy; lib-ms.local
</div>
{% endblock %}
